package gui.guilog;

import gui.customComponents.Tab;
import java.util.ArrayList;

public class GUILogController {
	private static gui.customComponents.GTTabPanel guilogPanel = null;

	public static gui.customComponents.GTTabPanel getComponent() {
		if (guilogPanel == null)
			guilogPanel = buildPane();

		return guilogPanel;
	}

	private static gui.customComponents.GTTabPanel buildPane() {
		return new GUILog();
	}

	/** basic tab information */
	private static Object[][] tabdata = { { "Console", true, null },
			{ "Summary", false, null }, };

	private static ArrayList<Tab> tabs = new ArrayList<Tab>();

	/**
	 * Load predefined tab information from array to a structured format, so we
	 * can use it to manage and
	 */
	private static void initTabs() {
		if (tabs.size() > 0)
			return;

		// clear
		tabs.clear();

		// get number of tabs
		int tabsize = tabdata.length / 3;
		// put tabs into array list of "tabs"
		for (int i = 0; i < tabsize; i++) {
			String tabname = (String) tabdata[i][0];
			boolean selected = (Boolean) tabdata[i][1];

			Tab newtab = new Tab(tabname, selected, null);
			tabs.add(newtab);
		}
	}
}
